/*****************************************************************************

FileName: 	<bitmap.h>

File Description:
Defines BMP file structures

*****************************************************************************/

#ifndef _BITMAP_H
#define _BITMAP_H


/*

A .bmp file contains of the following data structures:

BITMAPFILEHEADER    bmfh;
BITMAPINFOHEADER    bmih;
RGBQUAD             aColors[];
BYTE                aBitmapBits[];

*/



struct BITMAPFILEHEADER 
{
	UINT16 bfType;					/* must always be set to 'BM' to declare that this is a .bmp-file */
	UINT32 bfSize;					/* size of the file in bytes */
	UINT16 bfReserved1;				/* must always be set to zero */
	UINT16 bfReserved2;				/* must always be set to zero */
	UINT32 bfOffbits;				/* offset from the beginning of the file to the bitmap data */
};


struct BITMAPINFOHEADER
{
	UINT32 biSize;					/* size of the BITMAPINFOHEADER structure, in bytes */
	UINT32 biWidth;					/* width of the image, in pixels */
	UINT32 biHeight;				/* height of the image, in pixels */
	UINT16 biPlanes;				/* number of planes of the target device, must be set to zero */
	UINT16 biBitCount;				/* number of bits per pixel */
	UINT32 biCompression;			/* type of compression, usually set to zero (no compression) */
	UINT32 biSizeImage;				/* size of the image data, in bytes. If there is no compression, it is valid to set this member to zero */
	UINT32 biXPelsPerMeter;			/* horizontal pixels per meter on the designated target device, usually set to zero */
	UINT32 biYPelsPerMeter;			/* vertical pixels per meter on the designated target device, usually set to zero */
	UINT32 biClrUsed;				/* number of colors used in the bitmap, if set to zero the number of colors is calculated using the biBitCount member */
	UINT32 biClrImportant;			/* number of color that are 'important' for the bitmap, if set to zero, all colors are important */

};


struct RGBQUAD
{
	UINT8 rgbBlue;					/* blue part of the color */
	UINT8 rgbGreen;					/* green part of the color */
	UINT8 rgbRed;					/* red part of the color */
	UINT8 rgbReserved;				/* must always be set to zero */
};


struct bmpCodecObject
{
	BITMAPFILEHEADER bmfh;
	BITMAPINFOHEADER bmih;
	RGBQUAD			 *aColors;
	BYTE 			 *aBitmapBits;
};

#endif

